#!/usr/bin/env python3
# coding: utf-8

import numpy as np
import cv2 as cv

cap = cv.VideoCapture(0)
while True:
    ret,frame = cap.read()
    if not ret:
        print('video read error')
        break
    print('size = ',frame.shape)

    cv.imshow('frame', frame)
    if cv.waitKey(10) & 0xff == ord('q'):
        break

cap.release()
cv.destroyAllWindows()